<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Interface testing Tool</title>
    <!-- /static/css/reset.css -->
    <link  href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/scripts/jquery-3.2.1.min.js"></script>
    <script src="/static/bootstrap/js/bootstrap.min.js"></script>
     <style type="text/css">
        .url{
            width:411px;
            height:50px;
        }
        .post_mothod, .send{
            width:70px;
            height:50px;
            
        }
        .left,.right {
            padding: 10px;
            display: table-cell;
            border: 1px solid #aaaaaa;
        }
        
    </style>
  </head>
  <body>
    
    <div>
      <ul class="nav nav-tabs nav-justified">
        <li class="active"><a href="#">Interface Testing</a></li>
        <li><a href="#">url_decoding</a></li>
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">
            字符串处理<span class="caret"></span>
          </a>
          <ul class="dropdown-menu">
            <li><a href="#">xml_json</a></li>
            <li><a href="#">json_xml</a></li>
            <li><a href="#">MD5</a></li>
            <li class="divider"></li>
            <li><a href="#">分离的链接</a></li>
          </ul>
        </li>
        <li><a href="#">url_encoded</a></li>
      </ul>
    </div>
    <div class="left"  style="height:100%;height: 87vh;min-height:520px;padding:10px 10px 10px 30px;border:0;border-right:solid 1px #E5EBEE;border-bottom:solid 1px #eee;border-radius:0;resize: none; outline:none;font-size:10px;">
  	  <form  id="form1" class="" action="##" method="post">
        <select class="post_mothod" name="loc">
          <option value="GET_METHOD">GET</option>
          <option value="POST_METHOD">POST</option>
        </select>
  		  <input type="text" class="url"  name="url" value="" placeholder="在此输入请求地址" />
        <input type="button" class="send"  value="send" onclick="login()"  name="submit" />
        <!-- <select class="post_mothod1" name="loc">
          <option value="GET_METHOD">GET</option>
          <option value="POST_METHOD">POST</option>
        </select> -->
        <textarea  name="cotent" cols="89" rows="30" placeholder="在此输入请求报文" ></textarea> 
        {% csrf_token %}
      </form>
    </div>
      <div class="right" style="width:100%;height: 87vh;min-height:520px;border:solid 1px #f6f6f6;border-radius:0;resize: none;overflow-y:scroll; outline:none;position:relative;font-size:12px;padding-top:40px;">
        <p>{{result}}</p>
      </div>
  </body>
   <script type="text/javascript">
        function login(){
            $.ajax({
                cache: true,
                type: "POST",
                dataType: "json",
                url: "/interface/" ,
                data: $('#form1').serialize(),
                async: true,
                success: function(result){
                    console.log(result);
                // },
                // error : function(){
                //     alert("异常！");
                }
            })
        }
    </script>
</html>
